home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2001 / MacHack 2001.toast / pc / The Hacks / APLocation / Sources / Sample.r < prev    next >
Encoding:
Text File  |  2001-06-23  |  5.2 KB  |  208 lines

  1. /*
  2.      File:        Sample.r
  3.  
  4.      Contains:    Location Manager SDK Sample Rez data...
  5.  
  6.      Version:    ALM SDK 2.0
  7.                  Package:    Location Manager SDK 2.0
  8.  
  9.      Copyright:    © 1996-1997 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        Please include the the file and version information (from above) with
  13.                  the problem description.  Developers belonging to one of the Apple
  14.                  developer programs can submit bug reports to:
  15.  
  16.                      devsupport@apple.com
  17.  
  18. */
  19.  
  20. #define        thng_RezTemplateVersion        1
  21. #define        DLOG_RezTemplateVersion        1
  22.  
  23. // ------------------------------------------------------------------------------------------------- 
  24.  
  25. // Module Include...
  26.  
  27. #include    "APLocation.h"
  28.  
  29. // MacOS Includes...
  30.  
  31. #include    "Components.r"
  32. #include    "LocationManager.r"
  33.  
  34. // ------------------------------------------------------------------------------------------------- 
  35.  
  36. // Bring in the binary resource stuff...
  37.  
  38. include        "Sample.rsrc";
  39.  
  40. // ------------------------------------------------------------------------------------------------- 
  41.  
  42. // Information for the component manager -- ##### be sure to change the subtype!
  43.  
  44. resource 'thng' (128, "AirPort") {
  45.     kALMComponentType,
  46.     '1wse',        // Component Subtype--must be unique (use your registered creator)!
  47.     'nheg',        // Component Manufacturer--something descriptive (we use 'appl')
  48.     0x0,        // Flags (32 bits); could be kALMMultiplePerLocation and/or kALMDescriptionGetsStale
  49.     kAnyComponentFlagsMask,
  50.     kExecutableRsrcType, kExecutableRsrcID,
  51.     kNameRsrcType, kNameRsrcID,
  52.     kDescRsrcType, kDescRsrcID,
  53.     kIconRsrcType, kIconRsrcID,
  54.     0x0,    // Version
  55.     componentDoAutoVersion,
  56.     kIconRsrcID,
  57.     {}        // No platform info
  58. };
  59.  
  60. resource kNameRsrcType (kNameRsrcID, "Module Name") {
  61.     "AirPort"
  62. };
  63.  
  64. resource kDescRsrcType (kDescRsrcID, "Module Description") {
  65.     "This is an AirPort Location Manager module."
  66. };
  67.  
  68. // Internationalization in an easy place for internationalizers to get at it...
  69.  
  70. resource kALMAltScriptManagerInfoRsrcType (kALMAltScriptManagerInfoRsrcID, "Script Info") {
  71.     kALMScriptInfoVersion,
  72.     smRoman,        // Script
  73.     verUS,            // Version
  74.     langEnglish,    // Language
  75.     10,                // Size
  76.     "Geneva"        // Font
  77. };
  78.  
  79. // So that the Generic module can be customized, a list of applications, and
  80. // pairs of preference file resources...
  81.  
  82. resource kAppsRsrcType (kAppsQuitRsrcID, "Apps to Quit") {{
  83.     "MSWD", quitOnGetOrSet
  84. }};
  85.  
  86. resource kAppsRsrcType (kAppsEditRsrcID, "Apps to Launch") {{
  87.     "MSWD", launchFromEdit
  88. }};
  89.  
  90. resource kFilesRsrcType (kFilesRsrcStartID, "Word Settings (5)") {
  91.     "Word Settings (5)"
  92. };
  93.  
  94. resource kRestartRsrcType (kRestartRsrcStartID, "Word Settings (5)") {
  95.     kNoRestart
  96. };
  97.  
  98. // ------------------------------------------------------------------------------------------------- 
  99.  
  100. // Error messages; keep positions in sync with the error numbers...
  101.  
  102. resource 'STR#' (kSampleErrStrRsrcID, "Errors") {{
  103.     "Could not import because preferences on this machine match dates on imported set, "
  104.         "so there would be no way to tell them apart.",
  105.     "Could not quit an application using module’s preferences.",
  106.     
  107.     ""
  108. }};
  109.  
  110. resource 'STR#' (kSampleMiscStrRsrcID, "Misc Messages") {{
  111.     "Preference files containing ^0 modified at ^1 on ^2.",
  112.     
  113.     ""
  114. }};
  115.  
  116. // ------------------------------------------------------------------------------------------------- 
  117.  
  118. // Handy template resources so that we can use ResEdit/Resourcerer...
  119.  
  120. resource 'TMPL' (10000, "trip", purgeable) {{
  121.  
  122.     "Header Version",             "DWRD",
  123.     "Script Code",                 "DWRD",
  124.     "Region Code",                 "DWRD",
  125.     "Language Code",             "DWRD",
  126.     "Default Font Size",         "DWRD",
  127.     "Default Font Name",         "PSTR"
  128.  
  129. }};
  130.  
  131. resource 'TMPL' (10001, "thng", purgeable) {{
  132.  
  133.     "Component Type",             "TNAM",
  134.     "Component Subtype",         "TNAM",
  135.     "Component Manufacturer",    "TNAM",
  136.     "Register Component",        "BBIT",
  137.     "Fast Dispatch Calls",        "BBIT",
  138.     "Reserved",                 "BBIT",
  139.     "Reserved",                 "BBIT",
  140.     "Reserved",                 "BBIT",
  141.     "Reserved",                 "BBIT",
  142.     "Reserved",                 "BBIT",
  143.     "Reserved",                 "BBIT",
  144.     "Type Flags",                "HBYT",
  145.     "Subtype Flags",            "HBYT",
  146.     "Manufacturer Flags",        "HBYT",
  147.     "Flag Mask",                 "HLNG",
  148.     "Code Resource Type",         "TNAM",
  149.     "Code Resource ID",         "DWRD",
  150.     "Name Resource Type",         "TNAM",
  151.     "Name Resource ID",         "DWRD",
  152.     "Info Resource Type",         "TNAM",
  153.     "Info Resource ID",         "DWRD",
  154.     "Icon Resource Type",        "TNAM",
  155.     "Icon Resource ID",         "DWRD",
  156.     "Component Version",         "HLNG",
  157.     "Registration Flags",        "HLNG",
  158.     "Icon Family",                "DWRD",
  159.     "Reserved",                    "DWRD",
  160.     "Platform Count",            "OCNT",
  161.     "*****",                    "LSTC",
  162.     "Component Flags",            "HLNG",
  163.     "Code Type",                "HLNG",
  164.     "Code ID",                    "DWRD",
  165.     "Platform ID",                "DWRD",
  166.     "*****",                    "LSTE"
  167.  
  168. }};
  169.  
  170. resource 'TMPL' (10002, kAppsRsrcTypeString, purgeable) {{
  171.  
  172.     "Application Signatures",    "OCNT",
  173.     "*****",                    "LSTC",
  174.     "App Sig",                    "TNAM",
  175.     "OnSet",                    "BBIT",
  176.     "OnGet",                    "BBIT",
  177.     "OnEdit",                    "BBIT",
  178.     "Reserved",                    "BBIT",
  179.     "Reserved",                    "BBIT",
  180.     "Reserved",                    "BBIT",
  181.     "Reserved",                    "BBIT",
  182.     "Reserved",                    "BBIT",
  183.     "Align",                    "AWRD",
  184.     "*****",                    "LSTE"
  185.  
  186. }};
  187.  
  188. resource 'TMPL' (10003, kFilesRsrcTypeString, purgeable) {{
  189.  
  190.     "File Name",                "PSTR",
  191.  
  192. }};
  193.  
  194. resource 'TMPL' (10004, kRestartRsrcTypeString, purgeable) {{
  195.  
  196.     "Restart",                    "BBIT",
  197.     "Reserved",                    "BBIT",
  198.     "Reserved",                    "BBIT",
  199.     "Reserved",                    "BBIT",
  200.     "Reserved",                    "BBIT",
  201.     "Reserved",                    "BBIT",
  202.     "Reserved",                    "BBIT",
  203.     "Reserved",                    "BBIT",
  204.     "Align",                    "AWRD",
  205.  
  206. }};
  207.  
  208.